<?php

class News
{
	private $_news;
	
	public function __construct()
	{
		$this->_news = new Zend_Db_Table('news');
	}
	
	public function getList($Quantity = 0)
	{
		$SelectNews = $this->_news->select()->order('Text');
		
		if ($Quantity>0) $SelectNews = $SelectNews->limit($Quantity);

		$Rows = $this->_news->fetchAll($SelectNews);
		
		return $Rows->toArray();
	}
	
	public function getOne($ID)
	{		
		$Row = $this->_news->find($ID)->current();
		return $Row->toArray();
	}
	
	public function deleteNew($ID)
	{		
		
		$this->_news->delete('ID = ' . $ID);
	}
	
	public function editNew($ID)
	{		
		
		
	}
	
}